package java_thinking.unit_21._21_5;

public class SystemConstant {
    /**
     * 当前服务器可用 CPU 数，用于配置线程池
     */
    public static final int CPUs = Runtime.getRuntime().availableProcessors();

    public static void main(String[] args) {
        String outRule = "(A&&B)||C";
        StringBuilder condition = new StringBuilder();
        for (char c : outRule.toCharArray()) {
            if (65<=c && c <= 90 || 97<=c && c <= 122){
                String exp = "~";

                // 外部字段
                condition.append("(");
                condition.append("title").append(exp).append("'").append("a").append("'");
                condition.append(" OR ");
                condition.append("context").append(exp).append("'").append("b").append("'");
                condition.append(")");
                condition.append(" and ").append("record_id").append("=").append("'").append("c").append("'");
            } else {
                condition.append(String.valueOf(c));
            }

        }
        outRule = condition.toString().replaceAll("\\&\\&"," AND ").replaceAll("\\|\\|", " OR ");
        System.out.println(outRule);


    }
}